#include <iostream>
#include <cstdio>
#include <set>
#include <string>

using namespace std;

set<string> s;
string ss;

int main()
{
	int n, op;
	cin >> n;
	
	for(int i = 0; i < n; i++) {
		cin >> op >> ss;
		for(int j = 0; j < ss.size(); j++) {
			if(ss[j] >= 'A' && ss[j] <= 'Z') {
				ss[j] = 'a' + (ss[j] - 'A');
			}
		}

		if(0 == op) {
			s.insert(ss);
		} else {
			if(s.count(ss)) {
				cout << "Yes" << endl;
			} else {
				cout << "No" << endl;
			}
		}
	}

	return 0;
}